package com.shop.entity;

// Generated 2015-10-17 15:06:51 by Hibernate Tools 4.0.0

import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * SkuProd generated by hbm2java
 */
@Entity
@Table(name = "sku_prod", catalog = "shop")
public class SkuProd implements java.io.Serializable {

	private Integer skuprodId;
	private Category categoryBySku2Id1;
	private Category categoryBySku2Id2;
	private Product product;
	private Integer prodStore;
	private BigDecimal prodPrice;
	private Set<Cartitem> cartitems = new HashSet<Cartitem>(0);
	private Set<OrderRelate> orderRelates = new HashSet<OrderRelate>(0);

	public SkuProd() {
	}

	public SkuProd(SkuProd skuprod) {
		this.categoryBySku2Id1 = skuprod.getCategoryBySku2Id1();
		this.categoryBySku2Id2 = skuprod.getCategoryBySku2Id2();
		this.product = skuprod.getProduct();
		this.prodStore = skuprod.getProdStore();
		this.prodPrice = skuprod.getProdPrice();
		this.cartitems = skuprod.getCartitems();
		this.orderRelates = skuprod.getOrderRelates();
	}

	public SkuProd(Product product) {
		this.product = product;
	}

	public SkuProd(Category categoryBySku2Id1, Category categoryBySku2Id2,
			Product product, Integer prodStore, BigDecimal prodPrice,
			Set<Cartitem> cartitems, Set<OrderRelate> orderRelates) {
		this.categoryBySku2Id1 = categoryBySku2Id1;
		this.categoryBySku2Id2 = categoryBySku2Id2;
		this.product = product;
		this.prodStore = prodStore;
		this.prodPrice = prodPrice;
		this.cartitems = cartitems;
		this.orderRelates = orderRelates;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "skuprod_id", unique = true, nullable = false)
	public Integer getSkuprodId() {
		return this.skuprodId;
	}

	public void setSkuprodId(Integer skuprodId) {
		this.skuprodId = skuprodId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sku2_id1")
	public Category getCategoryBySku2Id1() {
		return this.categoryBySku2Id1;
	}

	public void setCategoryBySku2Id1(Category categoryBySku2Id1) {
		this.categoryBySku2Id1 = categoryBySku2Id1;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sku2_id2")
	public Category getCategoryBySku2Id2() {
		return this.categoryBySku2Id2;
	}

	public void setCategoryBySku2Id2(Category categoryBySku2Id2) {
		this.categoryBySku2Id2 = categoryBySku2Id2;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "prod_id", nullable = false)
	public Product getProduct() {
		return this.product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	@Column(name = "prod_store")
	public Integer getProdStore() {
		return this.prodStore;
	}

	public void setProdStore(Integer prodStore) {
		this.prodStore = prodStore;
	}

	@Column(name = "prod_price", precision = 7)
	public BigDecimal getProdPrice() {
		return this.prodPrice;
	}

	public void setProdPrice(BigDecimal prodPrice) {
		this.prodPrice = prodPrice;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "skuProd")
	public Set<Cartitem> getCartitems() {
		return this.cartitems;
	}

	public void setCartitems(Set<Cartitem> cartitems) {
		this.cartitems = cartitems;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "skuProd")
	public Set<OrderRelate> getOrderRelates() {
		return this.orderRelates;
	}

	public void setOrderRelates(Set<OrderRelate> orderRelates) {
		this.orderRelates = orderRelates;
	}

}
